home *** CD-ROM | disk | FTP | other *** search
/ The Essential Home & Business Collection / The Essential Home & Business Collection.iso / 27 / 3 / 5 / HP22D5.ZIP / EXTERN / CLICKAT.C < prev    next >
Text File  |  1991-04-16  |  750b  |  48 lines

  1. #include "extern.h"
  2.  
  3. /*
  4. ** This routine fakes a mouse click at a specified location.
  5. **
  6. ** To use this handler from HyperPAD:
  7. **
  8. **    clickat 10,10;
  9. **
  10. **    get the rect of page button 1;
  11. **    clickat item 1 of it,item 2 of it;
  12. */
  13. clickat(int NumArgs,HANDLE hx,HANDLE hy)
  14.  
  15. {
  16.     MSG msg;
  17.     SHAREDPTR pShared;
  18.  
  19.     if (NumArgs != 2) return(STOP);
  20.  
  21.     msg.Event = EVENT_LEFTBUTTONUP;
  22.     msg.ShiftStatus = 0;
  23.     msg.MouseX = htoi(hx);
  24.     msg.MouseY = htoi(hy);
  25.     msg.Buttons = 1;
  26.     msg.KeyWord = 0;
  27.     msg.AsciiCode = 0;
  28.     msg.ScanCode = 0;
  29.  
  30.     UnGetEvent(&msg);
  31.     msg.Event = EVENT_LEFTBUTTONDOWN;
  32.     UnGetEvent(&msg);
  33.  
  34.     return(STOP);
  35. }
  36.  
  37. POOL pascal Pool[] = {
  38.     {    "clickat",
  39.         clickat,
  40.         0,
  41.         HANDLER},
  42.  
  43.     {    NULL,
  44.         NULL,
  45.         0,
  46.         0}    };
  47.  
  48.